package cn.xiuxius.embedded.command.converter;

import cn.xiuxius.embedded.model.ClockSourceFlashOptionType;
import picocli.CommandLine;

public class ClockSourceConverter implements CommandLine.ITypeConverter<ClockSourceFlashOptionType> {
    @Override
    public ClockSourceFlashOptionType convert(String value) {
        try {
            return ClockSourceFlashOptionType.from(value.trim().toUpperCase());
        } catch (Exception e) {
            throw new CommandLine.TypeConversionException("Invalid ClockSource: " + value);
        }
    }
}

